/**
 * @program: FindFileDemo
 * @author: Ding Houwen
 * @create: 2019-08-01 13:05
 **/

package com.example.findfiledemo.controller;

import com.example.findfiledemo.service.AnyQService;
import com.example.findfiledemo.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@Api(value = "FileFindController", description = "AnyQ智能问答Controller")
@RestController
@RequestMapping("/anyq")
@CrossOrigin(allowedHeaders = "*", allowCredentials = "true")
public class AnyQController {
    @Autowired
    private FileService fileService;
    @Autowired
    private AnyQService anyQService;

    @ApiOperation(value = "AnyQ智能问答", notes = "根据用户的问题进行智能问答")
    @RequestMapping(value = "/anyq", method = RequestMethod.POST)
    @ApiImplicitParam(name = "name", value = "关键字", dataType = "String", paramType = "query", required = true)
    public String AnyQ(String name) {
        return anyQService.question(name);
    }

}

